/*
 *   Copyright 2021 zzh
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.aduib.boot.common.json;

import java.lang.reflect.Type;

/**
 * @description: ParamterzTypeComposite
 * @author: zzh
 * @date: 2021/9/8 14:58
 */
public class TypeCompositeToJson {
  /** 当json是对象时，对应的反序列化的对象可能是任意类型或者是Map类型 */
  private Type elementType;

  /** 当json是集合时，对应的反序列化的对象可能是数组或者集合(list/set) */
  private Type containerType;

  public TypeCompositeToJson(Type elementType, Type containerType) {
    this.elementType = elementType;
    this.containerType = containerType;
  }

  public static TypeCompositeToJson build(Type elementType, Type containerType) {
    return new TypeCompositeToJson(elementType, containerType);
  }

  public Type getElementType() {
    return elementType;
  }

  public void setElementType(Type elementType) {
    this.elementType = elementType;
  }

  public Type getContainerType() {
    return containerType;
  }

  public void setContainerType(Type containerType) {
    this.containerType = containerType;
  }
}
